<?
	$_SESSION['url'] = getURL();
	$act = $_GET['act'];
	$cm_id = intval($_GET['cm_id']);
	//HOME TOP LINK TO BACK
	
	if(!isset($_GET['pid'])){
		reHome($urlHome);
	}else{
		$pid = intval($_GET['pid']);
	}
	//
	
	$rs = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_id = '".$pid."' AND t_hienthi = 1");
	$row = $db->fetch_array($rs);
	if($db->num_rows($rs) == 0){ reHome($urlHome);}
	//
	$cid = $row[t_loaisanpham];
	$HomeLink = "<div><a href=\"".$root."/trang-chu/\">Trang chủ</a></div>";
	if(isset($cid)){
		$rs = $db->query("SELECT * FROM ".$prefix."loaisanpham WHERE c_id = '".$cid."' AND c_hienthi = 1");
		if($db->num_rows($rs) != 0){
			$row = $db->fetch_array($rs);
				$c_id_cha = $row[c_id_cha];
				$c_name = stripslashes($row[c_ten]);
				
				$rs2 = $db->query("SELECT * FROM ".$prefix."loaisanpham WHERE c_id = '".$c_id_cha."' AND c_hienthi = 1");
				$row2 = $db->fetch_array($rs2);
				$c_id2 = $row2[c_id];
				$c_name2 = stripslashes($row2[c_ten]);
				
				$HomeLink .= "<div><a href=\"".$root."/danh-muc-san-pham/".$c_id2."/".$myString->vietdecode($c_name2)."\">".$c_name2."</a></div><div><a href=\"".$root."/danh-muc-san-pham/".$cid."/".$myString->vietdecode($c_name)."\">".$c_name."</a></div>";
			
		}else{reHome($urlHome);}
	}else{reHome($urlHome);}
	
	$HomeLink .= "<div><a>Chi tiết sản phẩm</a></div>";
	
	
	///////////////////XU LY COMMENT /////////////////////
	if(isset($_POST['submit'])){
		if($_SESSION['is_login'] == true){
			$txtComment = addslashes($_POST['txtComment']);
			$pid = $_POST['pid'];
			$uid = $_POST['uid'];
			$edit = $_POST['edit'];
			if($edit == '1'){
				$db->query("UPDATE ".$prefix."sanpham_comment SET cm_content = '".$txtComment."' WHERE cm_id = '".$cm_id."'");
			}else{
				$db->query("INSERT INTO ".$prefix."sanpham_comment(cm_nguoidung,cm_sanpham_id,cm_content,cm_date) VALUES('".$uid."','".$pid."','".$txtComment."',now())");
			}
			header("Location: ".$root."/chi-tiet-san-pham/".$pid."/".$myString->vietdecode(loadTenChungLoaiTheoSanPham($pid))."");
		}
	}
	//////////////////////LUU SAN PHAM ///////////////////////
	if( (isset($_GET['act'])) && ($_GET['act'] == 'luusanpham') ){
	   if($_SESSION['is_login'] == true){
			$u_id = $_SESSION['uid'];
			$rs = $db->query("SELECT * FROM ".$prefix."nguoidung WHERE u_id = '".$u_id."'");
			$row = $db->fetch_array($rs);
			$u_sanphamluu = "";
			///
			if($row[u_sanphamluu] != ""){
				$arrList = split(";",$row[u_sanphamluu]);
				for($i=0;$i<count($arrList);$i++){
					if($arrList[$i] == $pid){
						Redirect("Sản phẩm này đã lưu ! Bạn không được lưu 2 lần ","?mod=chitietsp&pid=".$pid."");
					}
				}
				
				if($row[u_sanphamluu] != ""){
					$u_sanphamluu = $row[u_sanphamluu] . ";" . $pid;
				}else{
					$u_sanphamluu = $pid;
				}
				//ok
			}else{
				$u_sanphamluu = $pid;
			}
			$db->query("UPDATE ".$prefix."nguoidung SET u_sanphamluu = '".$u_sanphamluu."' WHERE u_id = '".$u_id."'");
	   }
	}
	
?>
<div class="linkPath">
<div class="linkPath-text">    
        <?=$HomeLink?>
        <span style="float: right;"><a title="Quay lại trang trước" class="link-back" href="javascript:void(0);" onclick="javascript:history.go(-1);">Quay lại</a></span>        
    
</div>    
</div>
    <!-- Main Page-Content { -->    
    <div id="page-content">      
        <div id="ctl00_idMainHolder_idProductPanel">

<?
	////UPDATE SO LAN XEM
		updateSoLanXem($pid);
		
	//UPDATE LAN XEM MOI NHAT
		updateXemGanNhat($pid);
	//
	$rs = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_id = '".$pid."' AND t_hienthi = 1");
	$row = $db->fetch_array($rs);
	$t_id = $row[t_id];
	$t_loaisanpham = $row[t_loaisanpham];
	$t_nguoidang = $row[t_nguoidang];
	$t_ten_nguoidang = tenNguoiDung($t_nguoidang);
	$t_tieude = $myString->unQuote(stripslashes($row[t_tieude]));
	$t_hinhanh = $PathFile . $row[t_hinhanh];
	$t_mota = $myString->unQuote(stripslashes($row[t_mota]));
	$t_giaban = showprice($row[t_giaban]);
	$t_loaitien = loadLoaiTien($row[t_loaitien]);
	$t_giathitruong = showprice($row[t_giathitruong]);
	$t_loaitien_giathitruong = loadLoaiTien($row[t_loaitien_giathitruong]);
	$t_quocgia = layQuocGia($row[t_quocgia]);
	$t_tinhthanh = layTinhThanh($row[t_tinhthanh]);
	$t_ngaydang = format_date($row[t_ngaydang]);
	$t_chitiet = $myString->unQuote(stripslashes($row[t_chitiet]));
	$t_phuongthucban = loadPhuongThucBanHang(t_phuongthucban);
	$t_solanxem = $row[t_solanxem];
	$t_noibat = $row[t_noibat];
	$t_khuyenmai = $row[t_khuyenmai];
	$t_sapramat = $row[t_sapramat];
	$t_xemgannhat = $row[t_xemgannhat];
?>	
                
<div id="product-summary">    
    <div class="corner-round-07-top-right">
        <div class="corner-round-07-top-left">
            <div class="corner-round-07-top-bg">
                <p>
                    Thông tin sản phẩm
                </p>

            </div>
        </div>
    </div>            
    <div class="corner-round-07-body">     
        <div id="panel-left">
            <div class="content"> 
                <div class="product-picture">
                    <p style="text-align:center;vertical-align:middle;margin-left:15px;margin-bottom:10px;">
                        <img src="<?=$root?>/<?=$t_hinhanh?>" alt="<?=$t_tieude?>" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';" width="120"/>
                    </p>

                </div> 
                <div class="product-info">
                    <h1 class="product-name"><?=$t_tieude?></h1>
                    <p class="product-summary2" style="font-size:8pt;margin-bottom:10px;margin-top:0px;"><?=$t_mota?>
					</p>
                    
                        <p><label>Giá thị trường:</label> &nbsp;<span style="font-weight:bold;"><?=$t_giathitruong?>&nbsp;<?=$t_loaitien_giathitruong?></span></p>
						
                    </p>
                    
                        <p><label>Giá bán:</label> &nbsp;<span class="product-price"><?=$t_giaban?>&nbsp;<?=$t_loaitien?></span></p>
						
						
                        
                    <p><label>Khu vực:</label> &nbsp;<?=$t_tinhthanh?></p> 
                    <p><label>Ngày đăng:</label> &nbsp;<span class="product-date"><?=$t_ngaydang?></span></p>              
					<p><label>
					<? if($t_khuyenmai == 1){ ?>
								<blink><font color="#0066FF" style="font-size:11px; font-weight:bold;">Khuyến mãi</font></blink>
								<? }?>
					</label> &nbsp;<span>
					<? if($t_sapramat == 1){ ?>
						<blink><font color="#0066FF" style="font-size:11px; font-weight:bold;">Sắp ra mắt</font></blink>
							<? }?>
					</span></p>                   
                    <div class="product-paymet">                        
                        <p style="margin-left:0px;">

                            <label style="float:none;margin-left:0px;">Cách mua hàng:</label>
                            &nbsp;<?=$t_phuongthucban?>
                        </p>                        
                    </div>
					
                
                </div>           
                <div class="clearBoth" style="margin-top:5px;"></div>             
            </div>     
               
            <div style="text-align:left;margin-left:10px;width:650px;font-size:10pt;">                
            <?
				if($_SESSION['is_login'] == true && $_SESSION['uid'] == $t_nguoidang){
			?>
				<a class="link-edit" href="<?=$root?>/sua-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>">Cập nhật</a>
                    &nbsp;|&nbsp;
                    <a class="link-delete" href="javascript:;" onclick="javascript: confirmDelete('<?=$root?>/action.php?act=del_sanpham&u_id=<?=$t_nguoidang?>&id=<?=$pid?>');">Xóa</a> &nbsp;|&nbsp;
					<a style="background:transparent url(<?=$root?>/themes/images/bookmark.png) no-repeat left -1px; padding-left:20px;" href="<?=$root?>/c-luu-san-pham/<?=$pid?>/<?=$myString->vietdecode($t_tieude)?>">Lưu sản phẩm</a>
			<? }else{ ?>
                    <a class="link-alert" title="Báo cho quản trị về nội dung thông tin." href="<?=$root?>/gop-y/">Báo quản trị</a>&nbsp;               
            <? } ?>    
                
            </div>

            
            
            <br style="line-height:1px;font-size:0px;clear:both;" />
        </div>  
        
        <div id="panel-right">        
            
    <div id="seller-summary" style="height:auto;overflow:hidden;">
        
		<!-- SELLER INFOMATION -->
		<?
			$rs2 = $db->query("SELECT * FROM ".$prefix."nguoidung WHERE u_id = '".$t_nguoidang."'");	
			$row2 = $db->fetch_array($rs2);
			$u_id = $row2[u_id];
			$u_capdo = $row2[u_capdo];
			$u_name = stripslashes($row2[u_name]);
			$u_tenshop = stripslashes($row2[u_tenshop]);
			$u_avatar = $PathThumbFile . $row2[u_avatar];
			$u_tinhthanh = layTinhThanh($row2[u_tinhthanh]);
			$u_dienthoaicodinh = stripslashes($row2[u_dienthoaicodinh]);
			$u_dienthoaididong = stripslashes($row2[u_dienthoaididong]);
			$u_nickchat = loadNickChat(0,$row2[u_nickchat]);
			$u_chuky = $myString->unQuote(stripslashes($row2[u_chuky]));
			
		?>
		<div class="content" style="margin-top:15px;height:auto;overflow:hidden;">
			   <table width="100%" cellpadding="5" cellspacing="0" border="0">
			   		<tr>
						<td width="15%">
							<p style="padding-left:5px;">                     
								<a href="<?=$root?>/shop-<?=$u_id?>/<?=$u_name?>" title="<?=$u_name?>" >                   
									<img alt="<?=$u_name?>" width="60px" src="<?=$root?>/<?=$u_avatar?>" onerror="this.src='<?=$root?>/themes/images/noavatar.jpg';"/>
								</a>                    
							</p>
			
							<p style="padding-left:5px;">
								<a class="seller" title="<?=$u_name?>" href="<?=$root?>/shop-<?=$u_id?>/<?=$u_name?>"><?=banned($u_id,$myString->cutString2($u_name,6));?></a>                 
							</p>
					  </td>
						<td width="85%" valign="top" style="padding-left:5px;">
							<p>
								<span class="seller-fullname"><a href="<?=$root?>/shop-<?=$u_id?>/<?=$u_name?>"><?=$u_tenshop?></a></span>                              
							</p>  
							
							<p>
								<span class="seller-level1">Số sản phẩm : <?=loadSoSanPhamTheoUser($u_id)?></span>
				
							</p>
				 
							<p>
								<span><label>Khu vực</label>: <?=$u_tinhthanh?></span>
							</p>
					  </td>
					</tr>
			   </table>
          
        </div>  
<!-- SELLER INFOMATION -->

        <div class="clearBoth" style="border-top:solid 1px #CCCCCC;margin-bottom:5px;"></div>                   
        <div style="width:auto;margin-left:5px;margin-right:5px;">  
            <ul class="user-contactInfo">                                
                <li><span class="seller-phone" style="line-height:18px;">
			<? if($u_dienthoaicodinh != ""){ ?>	
				<img style="vertical-align: bottom;" src="<?=$root?>/themes/images/form/phone/desk-phone.jpg"> <?=$u_dienthoaicodinh?> - 
			<? } if($u_dienthoaididong != ""){ ?>
				<img style="vertical-align: bottom;" src="<?=$root?>/themes/images/form/phone/mobi-phone.jpg"> <?=$u_dienthoaididong?>
				<? } ?>
				</span></li>                            
            </ul>           
            <ul class="user-function">              
                <li><a href="<?=$root?>/shop-<?=$u_id?>/<?=$u_name?>"><img src="<?=$root?>/themes/images/thanhtoan.gif" alt="Thông tin thanh toán" /></a></li>             
                <li><span><a href="<?=$root?>/gui-tin-nhan/<?=$u_name?>">Gởi tin nhắn riêng</a></span></li>

                <li><span><a href="<?=$root?>/san-pham/<?=$u_id?>/<?=$u_name?>">Xem tất cả sản phẩm</a></span></li>
                
                
                    <li><span><a href="<?=$root?>/ket-ban/<?=$u_id?>/<?=$u_name?>">Kết bạn</a></span></li>                
                
              
            </ul> 
            <ul class="user-chat">
                <li><label style="float:none;">Nick Chat:</label> </li><li style="padding-left:5px;"><img style="vertical-align: middle;" src="http://mail.opi.yahoo.com/online?u=<?=$u_nickchat?>&m=g&t=5">  <a href="ymsgr:sendim?<?=$u_nickchat?>"><?=$u_nickchat?></a></li>
            </ul>  
        </div>

        <br style="line-height:1px;font-size:0px;" />
    </div>

        </div>
        
        <div class="clearBoth"></div>
    </div>              
    <div class="corner-round-07-bottom-right">
        <div class="corner-round-07-bottom-left">
            <div class="corner-round-07-bottom-bg"></div>
        </div>

    </div>
</div>    


              
<div id="page-product-lpane"> 
                
                
<div id="product-detail">
    <div class="header" style="height:27px;padding:12px 0px 5px 10px;">Mô tả chi tiết</div>
    <div class="line"></div>
    <div class="product-detail-inner" style="height:auto;overflow:hidden;">

        <div class="corner-round-02-top-right"><div class="corner-round-02-top-left"><div class="corner-round-02-top-bg"></div></div></div>
        <div class="corner-round-02-body product-detail-description" style="height:auto;overflow:hidden;">  
          <?=$t_chitiet?>

           <div class="signature" style="border-top:dasded 1px #CCCCCC;margin-top:35px;">
                <p style="margin:0px;margin-top:5px;">
                    <?=$u_chuky?>
                </p>
           </div>      
           
             <div style="text-align:right;">
                <a href="javascript:void(0)" style="font-style:normal;font-size:8pt;">
             <img src="<?=$root?>/themes/images/home/btnUp.jpg" style="border:0;" alt="Up" title="Up sản phẩm" />
                </a>
             </div>        
                      
           <div class="date" style="margin-top:5px;font-style:normal;font-size:8pt;text-align:right;">
                <?
					if($_SESSION['is_login'] == true && $_SESSION['uid'] == $t_nguoidang){
				?>   
				    <a class="link-edit" extag="own" href="<?=$root?>/sua-san-pham/<?=$t_id?>" style="font-style: normal; font-size: 8pt;">Cập nhật</a> | 
                    <a class="link-delete" extag="own" href="javascript:;" onclick="javascript: confirmDelete('<?=$root?>/action.php?act=del_sanpham&u_id=<?=$t_nguoidang?>&id=<?=$pid?>');">Xóa</a> |
				<? } ?>
                    
     	   </div>                          
        </div>       
        <div class="corner-round-02-bottom-right"><div class="corner-round-02-bottom-left"><div class="corner-round-02-bottom-bg"></div></div></div>
    </div>
</div>

<!-- COMMENT PRODUCTS { -->


<span class="comment-title">Bình Luận</span>

<div id="product-comments">    
    <div class="product-detail-inner">
            <div id="product-comment">       
                <?
                        // variables
                        $sql = "SELECT * FROM ".$prefix."sanpham_comment WHERE cm_sanpham_id = '".$pid."' ORDER BY cm_id DESC";
    					$pp=10; 
    					$parr=array();
    					$parr=paging($sql,$pp);
    					$page=$parr[0];
    					$limitvalue=$parr[1];
    					$numofpages=$parr[2];
    					$sql.=" LIMIT $limitvalue, $pp";
                        
                        $rs3 = $db->query($sql);
                        
                        if($db->num_rows($rs3) != 0)
                        {
                    		$st = 0;
                    		while($row3 = $db->fetch_array($rs3))
                            {
                        		$st++;
                        		$cm_id = $row3[cm_id];
                        		$cm_date = format_date_time($row3[cm_date]);
                        		$cm_content = $myString->unQuote(stripslashes($row3[cm_content]));
                        		$cm_nguoidung = $row3[cm_nguoidung];
                        		$cm_ten_nguoidung = tenNguoiDung($cm_nguoidung);
                        		$cm_avatar_nguoidung = $PathThumbFile . loadAvatar($cm_nguoidung);
                        		$cm_chuky_nguoidung = loadChuKy($cm_nguoidung);
                ?>
							  
                <!-- LIST Comment { -->	                                                  
                <div class="product-comment-item" style="height:auto;overflow:hidden;">
                    <div style="height:14px;background-color:#FFFFFF;font-size:8pt;line-height:14px;margin-bottom:5px;color:#666666;">
                                    <div style="float:left">
                                        <?=$cm_date?>                                       
                                    </div>

                                    <div style="float:right; padding-right:80px;">
                                        #<?=$st?>                                       
                                    </div>   
                    </div>  
                    <div class="clear"></div>
                                
                    <div class="panel-left">
                        <div class="picture-profile1" style="margin-bottom:5px;">
                                            <p>                                                
                                                <a extag="own" title="<?=$cm_ten_nguoidung?>" href="<?=$root?>/shop-<?=$cm_nguoidung?>/<?=tenNguoiDung2($cm_nguoidung)?>">
                                                    <img width="60px" alt="<?=$cm_ten_nguoidung?>" src="<?=$cm_avatar_nguoidung?>" onerror="this.src='<?=$root?>/themes/images/noavatar.jpg';"/>
                                                </a>
    
                                            </p>
                                            <p style="text-align:left">
                                                <a extag="own" class="seller" href="<?=$root?>/shop-<?=$cm_nguoidung?>/<?=tenNguoiDung2($cm_nguoidung)?>" title="<?=$cm_ten_nguoidung?>">
                                                <span class="sellername"><?=banned($cm_nguoidung,$myString->cutString2($cm_ten_nguoidung,6));?></span>
                                                </a>
                                            </p>
                        </div>  								 
                        <div class="message" style="padding-left:5px;">

									<!-- CONTENT -->  
                                    <?=$cm_content?>
									    
                        </div>                       
                    </div>   
                                
					<div class="panel-right">
                         
                        <div class="signature">   
							<?=$cm_chuky_nguoidung?>
						</div>
                        <div class="date1" style="margin-top:5px;font-style:normal;font-size:8pt;margin-right:80px; text-align:right;">
						<?
							if($_SESSION['is_login'] == true && $_SESSION['uid'] == $cm_nguoidung){
						?>
						<a extag="own" class="link-edit" href="<?=$root?>/sua-nhan-xet/<?=$pid?>/<?=$cm_id?>" style="font-style: normal; font-size: 8pt;">Cập nhật</a> | 
						
						<? } ?>
						
                        <? 
						 if($_SESSION['is_login'] == true && ($_SESSION['uid'] == $t_nguoidang || $_SESSION['uid'] == $cm_nguoidung) ){
						?>
						
						<a class="link-delete" extag="own" href="javascript:;" onclick="javascript: confirmDelete('<?=$root?>/action.php?act=del_comment&id=<?=$cm_id?>&u_id=<?=$u_id?>');">Xóa</a> | 
						<? } ?>
                            <a extag="own" title="Trích dẫn nội dung bài viết" href="<?=$root?>/trich-dan-nhan-xet/<?=$pid?>/<?=$cm_id?>"  style="font-style:normal;font-size:8pt;" class="quote">Trích dẫn</a> | 
                            
                            <a extag="own" class="link-alert" title="Báo cho quản trị về nội dung thông tin." href="<?=$root?>/gop-y/">
                                Báo quản trị
                            </a>                    
                        
                        </div>                                     
                    </div>  
								                                    
                    </div> 
                    <!--  } LIST Comment -->                                                    
       <? } ?> 
			 <p align="left" class="font" style="padding-left:320px;">
				 <?php echo page_div( "".$root."/?mod=chitietsp&pid=".$pid."&p=%d_pg", "10", ceil ( $numofpages ), $page ); ?>
			 </p>               
<?  }
    else
    { ?>

	<div class="product-comment-item" style="height:auto;overflow:hidden;">
		<p>Chưa có bình luận nào.</p>
	</div>
<?  } ?>


<?	
	function comment($act,$cm_id,$pid,$uid)
    {
		global $db,$prefix, $root, $myString;
			echo "<p class=\"message-bar\" style=\"margin-top:10px;\"></p>
                    
					
<form action=\"\" name=\"frmComment\" id=\"frmComment\" method=\"post\">                    
                   
				   <div style=\"padding-left:10px; margin-top:10px;\">";
                   
						
				if($act == "quote_comment"){	
									
						$rs4 = $db->query("SELECT * FROM ".$prefix."sanpham_comment WHERE cm_id = '".$cm_id."'");
						if($db->num_rows($rs4) != 0){	
							$row4 =$db->fetch_array($rs4);
							$txtContent = $myString->unQuote(stripslashes($row4[cm_content]));
							$cm_ten_nguoidung = tenNguoiDung($row4[cm_nguoidung]);
						}else{
							reHome($urlHome);
						}
						
							echo "<textarea id=\"elm2\" name=\"txtComment\" style=\"width:80%;height:300px;font-family:Verdana;font-size:10pt;border:solid 1px #CCCCCC\">
							Nguyên văn bởi : <b>".$cm_ten_nguoidung."</b>
							<br /><br />
							<div style=\"padding-left: 10px;\">
							<i>".$txtContent."</i>
							</div>
							<br />
							-----------------------------------------
							<br /><br />
							</textarea>";
                  }else if($act == "edit_comment"){ 
				 		$rs4 = $db->query("SELECT * FROM ".$prefix."sanpham_comment WHERE cm_id = '".$cm_id."'");
						if($db->num_rows($rs4) != 0){	
							$row4 =$db->fetch_array($rs4);
							$txtContent = $myString->unQuote(stripslashes($row4[cm_content]));
						}else{
							reHome($urlHome);
						}
				 
				 	echo "<textarea id=\"elm2\" name=\"txtComment\" style=\"width:80%;height:300px;font-family:Verdana;font-size:10pt;border:solid 1px #CCCCCC\">".$txtContent."</textarea>
					<input type=\"hidden\" name=\"edit\" id=\"edit\" value=\"1\" />
					<input type=\"hidden\" name=\"cm_id\" id=\"cm_id\" value=\"".$cm_id."\" />";
				 
				  }else
                  { 
				 		echo "<textarea id=\"\" name=\"txtComment\" style=\"width:80%;height:300px;font-family:Verdana;font-size:10pt;border:solid 1px #CCCCCC\"></textarea>";
				  }      
                   
					
                   echo "<div style=\"margin-top:10px; margin-right:20px;\" align=\"right\">
                        <p style=\"line-height:20px;\">
						
                        <span id=\"Error Save\" style=\"color:Red;font-weight:bold;\"></span>
                        	<input type=\"hidden\" name=\"submit\" id=\"submit\" value=\"submit\" />
							<input type=\"hidden\" name=\"pid\" id=\"pid\" value=\"".$pid."\" />";
						
								
							
							echo "<input type=\"hidden\" name=\"uid\" id=\"uid\" value=\"".$uid."\"/>
                            <input id=\"txtSave\" name=\"txtSave\" type=\"image\" src=\"".$root."/themes/images/home/btncomment.jpg\" />&nbsp;

                       
                        </p>
                    </div>
					
					</div>
</form>";	
	}
	
	$uid = $_SESSION['uid'];
	
	
	//if(loadConfigUser($t_nguoidang,0) == 0)
    //{
		if($_SESSION['is_login'] == true)
        {
			comment($act,$cm_id,$pid,$uid);
		}
	//}

?>
    </div>    
</div>

<!-- END COMMENT PRODUCTS -->    
             
</div>         
            <div id="page-product-rpane">                
                

<div id="products-seller">
    <div class="corner-round-07-top-right">
        <div class="corner-round-07-top-left">
            <div class="corner-round-07-top-bg">
                <p>
                    Sản phẩm cùng người bán
                </p>

            </div>
        </div>
    </div>   
    <div  class="corner-round-02-body .padding">
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td>  
                <div class="content" style="margin-left:2px;margin-right:1px;">
                    
					
					<?
						$rs5 = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_nguoidang = '".$t_nguoidang."' AND t_hienthi = 1 AND t_id != '".$pid."' order by t_id DESC LIMIT 10");
						while($row5 = $db->fetch_array($rs5)){
						$t_id = $row5[t_id];
						$t_loaisanpham = $row5[t_loaisanpham];
						$t_tieude = $myString->unQuote(stripslashes($row5[t_tieude]));
						echo $t_tieude;
						$t_hinhanh = $PathThumbFile . $row5[t_hinhanh];
						echo $t_hinhanh;
						$t_giaban = showprice($row5[t_giaban]);
						$t_loaitien = loadLoaiTien($row5[t_loaitien]);
						$t_tinhthanh = layTinhThanh($row5[t_tinhthanh]);
					?>
					
					<!-- SP CUNG NGUOI BAN -->
                            <div class="row">
                                <table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr><td valign="top" style="padding:5px;"> 
                                    <p>
                                        <a href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>" class="product-name" title="<?=$t_tieude?>">
                                            <img alt="<?=$t_tieude?>" width="100px" style="vertical-align:middle" src="<?=$root?>/<?=$t_hinhanh?>" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';"/>
                                        </a>
                                    </p>
                               
								</td>
								<td valign="top" align="left">
                                    <h1>
                                        <a href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>" class="product-name"><?=$t_tieude?></a>

                                    </h1>
                                    <p><span class="product-price"><?=$t_giaban?> <?=$t_loaitien?></span></p>
                                    <p><?=$t_tinhthanh?></p>
                             
								</td></tr>
								</table>
                            </div>
                            <div class="bar"></div>
					<? } ?>
				
                    <div class="row" style="text-align:right;margin-right:10px">
                        <a href="<?=$root?>/san-pham/<?=$u_id?>/<?=$u_name?>" class="view-more">Xem thêm</a>

                    </div>
                    <div class="clearBoth"></div>
                </div>        
                <br style="line-height:1px;font-size:0px;" />
            </td>
        </tr>
    </table> 
    </div>
    <div class="corner-round-02-bottom-right">
        <div class="corner-round-02-bottom-left">

            <div class="corner-round-02-bottom-bg"></div>
        </div>
    </div>
</div>
                                
            </div>  
        
</div>    
                  
    </div>
    <div style="clear:both;"></div>    
   
   <?
    file_exist('includes/inc_sanpham_dambao_thanhtoan.php');
   	include('includes/inc_sanpham_dambao_thanhtoan.php');
   ?>
   
    <!-- } Main Page-Content -->  
            
